﻿CREATE TABLE [dbo].[OrderRequest] (
    [Id]                       UNIQUEIDENTIFIER ROWGUIDCOL NOT NULL,
    [RefNumber]                NVARCHAR (50)    NOT NULL,
    [OrderDate]                DATETIME         NULL,
    [CurrencyId]               UNIQUEIDENTIFIER NOT NULL,
    [DeliveryDate]             DATETIME         NULL,
    [RequestedDestinationId]   UNIQUEIDENTIFIER NULL,
    [FinalDestinationId]       UNIQUEIDENTIFIER NULL,
    [Remarks]                  NTEXT            NULL,
    [PreparedBy]               UNIQUEIDENTIFIER NOT NULL,
    [ReviewedBy]               UNIQUEIDENTIFIER NULL,
    [AuthorizedBy]             UNIQUEIDENTIFIER NULL,
    [PreparedOn]               DATETIME         NULL,
    [ReviewedOn]               DATETIME         NULL,
    [AuthorizedOn]             DATETIME         NULL,
    [TotalAmount]              MONEY            NULL,
    [FromOneBL]                BIT              NULL,
    [CountryProgrammeId]       UNIQUEIDENTIFIER NULL,
    [IsReviewed]               BIT              NULL,
    [IsAuthorized]             BIT              NULL,
    [RejectedReviewRemarks]    NVARCHAR (550)   NULL,
    [RejectedAuthorizeRemarks] NVARCHAR (550)   NULL,
    [CountrySubProgrammeId]    UNIQUEIDENTIFIER NULL,
    [RecordCount]              INT              IDENTITY (1, 1) NOT NULL,
    [MBCurrencyId]             UNIQUEIDENTIFIER NULL,
    [MBValue]                  MONEY            NULL,
    [ProjectDonorId]           UNIQUEIDENTIFIER NULL
);


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Flag whether OrderRequest should be picked from one budget line or not', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'OrderRequest', @level2type = N'COLUMN', @level2name = N'FromOneBL';

